package net.borlis.errors.exceptions;

/**
 * The main exception for the mw side.
 * {@link ServerException}.
 *
 * @author alex@borlis.net
 */
public class ServerException extends RuntimeException {

    private IExceptionKeyMaster keyMaster;

    public ServerException(IExceptionKeyMaster keyMaster) {
        super(keyMaster.toString());
        this.keyMaster = keyMaster;
    }

    public ServerException(IExceptionKeyMaster keyMaster, Throwable cause) {
        super("{" + keyMaster.getCode() + "}" + keyMaster.getKey(), cause);
        this.keyMaster = keyMaster;
    }

    public IExceptionKeyMaster getKeyMaster() {
        return keyMaster;
    }

}
